﻿


using System;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.Serialization;

namespace UFIDA.U9.Cust.SH.SHFastShipSV
{
	/// <summary>
	/// 快速出货单头 DTO :自定义的数据传输类型 
	/// 
	/// </summary>
	public  partial class FastShipDTO  : UFSoft.UBF.Business.DTOBase
	{
		#region Constructor
		
		/// <summary>
		/// Constructor
		/// </summary>
		public FastShipDTO(){
			initData();
		}
		private void initData()
		{
		
		
		
		
		
					IsZY = false; 
		
		
					DocState =UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState.GetFromValue(-1); 
		
		
		
		
					CreditNoCheck = false; 
		
					GSCheck = false; 
					KHCheck = false; 
		
		

		}

		#endregion
		
		#region Properties
			/// <summary>
		/// 单据类型 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.单据类型
		/// </summary>
		/// <value>UFIDA.U9.SM.Ship.ShipDocType</value>
		public UFIDA.U9.SM.Ship.ShipDocType DocType
		{
			get	
			{	
				return (UFIDA.U9.SM.Ship.ShipDocType)base.GetValue("DocType",typeof(UFIDA.U9.SM.Ship.ShipDocType));
			}

			 set	
			{
				base.SetValue("DocType",value);
			}
		}
				/// <summary>
		/// 单号 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.单号
		/// </summary>
		/// <value>System.String</value>
		public System.String DocNo
		{
			get	
			{	
				return (System.String)base.GetValue("DocNo",typeof(System.String));
			}

			 set	
			{
				base.SetValue("DocNo",value);
			}
		}
				/// <summary>
		/// 客户 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.客户
		/// </summary>
		/// <value>UFIDA.U9.CBO.SCM.Customer.Customer</value>
		public UFIDA.U9.CBO.SCM.Customer.Customer Customer
		{
			get	
			{	
				return (UFIDA.U9.CBO.SCM.Customer.Customer)base.GetValue("Customer",typeof(UFIDA.U9.CBO.SCM.Customer.Customer));
			}

			 set	
			{
				base.SetValue("Customer",value);
			}
		}
				/// <summary>
		/// 单据日期 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.单据日期
		/// </summary>
		/// <value>System.DateTime</value>
		public System.DateTime DocDate
		{
			get	
			{	
				return (System.DateTime)base.GetValue("DocDate",typeof(System.DateTime));
			}

			 set	
			{
				base.SetValue("DocDate",value);
			}
		}
				/// <summary>
		/// 总经销仓库 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.总经销仓库
		/// </summary>
		/// <value>UFIDA.U9.CBO.SCM.Warehouse.Warehouse</value>
		public UFIDA.U9.CBO.SCM.Warehouse.Warehouse SaleWH
		{
			get	
			{	
				return (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)base.GetValue("SaleWH",typeof(UFIDA.U9.CBO.SCM.Warehouse.Warehouse));
			}

			 set	
			{
				base.SetValue("SaleWH",value);
			}
		}
				/// <summary>
		/// 是否直运 (该属性可为空,但有默认值)
		/// 快速出货单头.Misc.是否直运
		/// </summary>
		/// <value>System.Boolean</value>
		public System.Boolean IsZY
		{
			get	
			{	
				return (System.Boolean)base.GetValue("IsZY",typeof(System.Boolean));
			}

			 set	
			{
				base.SetValue("IsZY",value);
			}
		}
				/// <summary>
		/// 直运客户 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.直运客户
		/// </summary>
		/// <value>UFIDA.U9.CBO.SCM.Customer.Customer</value>
		public UFIDA.U9.CBO.SCM.Customer.Customer ZYCustomer
		{
			get	
			{	
				return (UFIDA.U9.CBO.SCM.Customer.Customer)base.GetValue("ZYCustomer",typeof(UFIDA.U9.CBO.SCM.Customer.Customer));
			}

			 set	
			{
				base.SetValue("ZYCustomer",value);
			}
		}
				/// <summary>
		/// 销售业务类型 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.销售业务类型
		/// </summary>
		/// <value>UFIDA.U9.Base.FlexField.ValueSet.DefineValue</value>
		public UFIDA.U9.Base.FlexField.ValueSet.DefineValue SaleType
		{
			get	
			{	
				return (UFIDA.U9.Base.FlexField.ValueSet.DefineValue)base.GetValue("SaleType",typeof(UFIDA.U9.Base.FlexField.ValueSet.DefineValue));
			}

			 set	
			{
				base.SetValue("SaleType",value);
			}
		}
				/// <summary>
		/// 单据状态 (该属性可为空,但有默认值)
		/// 快速出货单头.Misc.单据状态
		/// </summary>
		/// <value>UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState</value>
		public UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState DocState
		{
			get	
			{	
				return (UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState)base.GetValue("DocState",typeof(UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState));
			}

			 set	
			{
				base.SetValue("DocState",value);
			}
		}
				/// <summary>
		/// 运营组织 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.运营组织
		/// </summary>
		/// <value>UFIDA.U9.Base.Organization.Organization</value>
		public UFIDA.U9.Base.Organization.Organization Org
		{
			get	
			{	
				return (UFIDA.U9.Base.Organization.Organization)base.GetValue("Org",typeof(UFIDA.U9.Base.Organization.Organization));
			}

			 set	
			{
				base.SetValue("Org",value);
			}
		}
				/// <summary>
		/// 仓库 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.仓库
		/// </summary>
		/// <value>UFIDA.U9.CBO.SCM.Warehouse.Warehouse</value>
		public UFIDA.U9.CBO.SCM.Warehouse.Warehouse WH
		{
			get	
			{	
				return (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)base.GetValue("WH",typeof(UFIDA.U9.CBO.SCM.Warehouse.Warehouse));
			}

			 set	
			{
				base.SetValue("WH",value);
			}
		}
				/// <summary>
		/// 备注 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.备注
		/// </summary>
		/// <value>System.String</value>
		public System.String Memo
		{
			get	
			{	
				return (System.String)base.GetValue("Memo",typeof(System.String));
			}

			 set	
			{
				base.SetValue("Memo",value);
			}
		}
				/// <summary>
		/// 部门 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.部门
		/// </summary>
		/// <value>UFIDA.U9.CBO.HR.Department.Department</value>
		public UFIDA.U9.CBO.HR.Department.Department Dept
		{
			get	
			{	
				return (UFIDA.U9.CBO.HR.Department.Department)base.GetValue("Dept",typeof(UFIDA.U9.CBO.HR.Department.Department));
			}

			 set	
			{
				base.SetValue("Dept",value);
			}
		}
				/// <summary>
		/// 信用免检 (该属性可为空,但有默认值)
		/// 快速出货单头.Misc.信用免检
		/// </summary>
		/// <value>System.Boolean</value>
		public System.Boolean CreditNoCheck
		{
			get	
			{	
				return (System.Boolean)base.GetValue("CreditNoCheck",typeof(System.Boolean));
			}

			 set	
			{
				base.SetValue("CreditNoCheck",value);
			}
		}
				/// <summary>
		/// 门店单号 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.门店单号
		/// </summary>
		/// <value>System.String</value>
		public System.String MDDocNo
		{
			get	
			{	
				return (System.String)base.GetValue("MDDocNo",typeof(System.String));
			}

			 set	
			{
				base.SetValue("MDDocNo",value);
			}
		}
				/// <summary>
		/// 公司确认 (该属性可为空,但有默认值)
		/// 快速出货单头.Misc.公司确认
		/// </summary>
		/// <value>System.Boolean</value>
		public System.Boolean GSCheck
		{
			get	
			{	
				return (System.Boolean)base.GetValue("GSCheck",typeof(System.Boolean));
			}

			 set	
			{
				base.SetValue("GSCheck",value);
			}
		}
				/// <summary>
		/// 客户确认 (该属性可为空,但有默认值)
		/// 快速出货单头.Misc.客户确认
		/// </summary>
		/// <value>System.Boolean</value>
		public System.Boolean KHCheck
		{
			get	
			{	
				return (System.Boolean)base.GetValue("KHCheck",typeof(System.Boolean));
			}

			 set	
			{
				base.SetValue("KHCheck",value);
			}
		}
				/// <summary>
		/// 订单说明 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.订单说明
		/// </summary>
		/// <value>System.String</value>
		public System.String MDMemo
		{
			get	
			{	
				return (System.String)base.GetValue("MDMemo",typeof(System.String));
			}

			 set	
			{
				base.SetValue("MDMemo",value);
			}
		}
				/// <summary>
		/// 行集合 (该属性可为空,且无默认值)
		/// 快速出货单头.Misc.行集合
		/// </summary>
		/// <value></value>
		public List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO> Lines
		{
			get	
			{	
				return (List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO>)base.GetValue("Lines",typeof(List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO>));
			}

			 set	
			{
				base.SetValue("Lines",value);
			}
		}
		
		#endregion	
		#region Multi_Fields
																			
		#endregion 

		#region ModelResource
		/// <summary>
		/// 快速出货单头的显示名称资源--已经废弃，不使用.
		/// </summary>
		public string Res_TypeName {	get {return "" ;}	}
		/// <summary>
		/// 单据类型的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_DocType　{ get { return "";　}　}
		/// <summary>
		/// 单号的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_DocNo　{ get { return "";　}　}
		/// <summary>
		/// 客户的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Customer　{ get { return "";　}　}
		/// <summary>
		/// 单据日期的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_DocDate　{ get { return "";　}　}
		/// <summary>
		/// 总经销仓库的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_SaleWH　{ get { return "";　}　}
		/// <summary>
		/// 是否直运的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_IsZY　{ get { return "";　}　}
		/// <summary>
		/// 直运客户的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_ZYCustomer　{ get { return "";　}　}
		/// <summary>
		/// 销售业务类型的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_SaleType　{ get { return "";　}　}
		/// <summary>
		/// 单据状态的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_DocState　{ get { return "";　}　}
		/// <summary>
		/// 运营组织的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Org　{ get { return "";　}　}
		/// <summary>
		/// 仓库的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_WH　{ get { return "";　}　}
		/// <summary>
		/// 备注的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Memo　{ get { return "";　}　}
		/// <summary>
		/// 部门的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Dept　{ get { return "";　}　}
		/// <summary>
		/// 信用免检的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_CreditNoCheck　{ get { return "";　}　}
		/// <summary>
		/// 门店单号的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_MDDocNo　{ get { return "";　}　}
		/// <summary>
		/// 公司确认的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_GSCheck　{ get { return "";　}　}
		/// <summary>
		/// 客户确认的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_KHCheck　{ get { return "";　}　}
		/// <summary>
		/// 订单说明的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_MDMemo　{ get { return "";　}　}
		/// <summary>
		/// 行集合的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Lines　{ get { return "";　}　}
		#endregion 




		#region EntityData exchange
		
		#region  Do SerializeKey -ForDTOType
		//反序化Key到Data的ID中　－－由FromEntityData自动调用，不处理层次关系
		private void DeSerializeKey(FastShipDTOData data)
		{
		



















		}

		#endregion 
		
		/// <summary>
		/// Copy Entity From EntityData
		/// </summary>
		public void FromEntityData(FastShipDTOData data)
		{
			this.FromEntityData(data,new Hashtable());
		}
		//used by ubf..
		public void FromEntityData(FastShipDTOData data,IDictionary dict)
		{
			if (data == null)
				return;
			if (dict == null ) dict = new Hashtable() ;
			dict[data] = this;
			DeSerializeKey(data);
		
			{
			if (data.DocType!=null)
			{
				UFIDA.U9.SM.Ship.ShipDocType child = dict[data.DocType] as UFIDA.U9.SM.Ship.ShipDocType ;
				if (child == null)
				{
					if (data.DocType.ID>0)
					{
						if (data.DocType.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.SM.Ship.ShipDocType)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.DocType.ID,data.DocType.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.SM.Ship.ShipDocType)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.DocType.SysEntityType,null,data.DocType.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.SM.Ship.ShipDocType)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.DocType.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.DocType, dict);
				}
				this.DocType = child ;
			}
			else
				this.DocType = null ;
			}

			this.DocNo = data.DocNo;

			{
			if (data.Customer!=null)
			{
				UFIDA.U9.CBO.SCM.Customer.Customer child = dict[data.Customer] as UFIDA.U9.CBO.SCM.Customer.Customer ;
				if (child == null)
				{
					if (data.Customer.ID>0)
					{
						if (data.Customer.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.SCM.Customer.Customer)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.Customer.ID,data.Customer.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.SCM.Customer.Customer)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Customer.SysEntityType,null,data.Customer.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.SCM.Customer.Customer)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Customer.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.Customer, dict);
				}
				this.Customer = child ;
			}
			else
				this.Customer = null ;
			}

			this.DocDate = data.DocDate;

			{
			if (data.SaleWH!=null)
			{
				UFIDA.U9.CBO.SCM.Warehouse.Warehouse child = dict[data.SaleWH] as UFIDA.U9.CBO.SCM.Warehouse.Warehouse ;
				if (child == null)
				{
					if (data.SaleWH.ID>0)
					{
						if (data.SaleWH.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.SaleWH.ID,data.SaleWH.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.SaleWH.SysEntityType,null,data.SaleWH.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.SaleWH.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.SaleWH, dict);
				}
				this.SaleWH = child ;
			}
			else
				this.SaleWH = null ;
			}

			this.IsZY = data.IsZY;

			{
			if (data.ZYCustomer!=null)
			{
				UFIDA.U9.CBO.SCM.Customer.Customer child = dict[data.ZYCustomer] as UFIDA.U9.CBO.SCM.Customer.Customer ;
				if (child == null)
				{
					if (data.ZYCustomer.ID>0)
					{
						if (data.ZYCustomer.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.SCM.Customer.Customer)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.ZYCustomer.ID,data.ZYCustomer.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.SCM.Customer.Customer)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.ZYCustomer.SysEntityType,null,data.ZYCustomer.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.SCM.Customer.Customer)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.ZYCustomer.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.ZYCustomer, dict);
				}
				this.ZYCustomer = child ;
			}
			else
				this.ZYCustomer = null ;
			}

			{
			if (data.SaleType!=null)
			{
				UFIDA.U9.Base.FlexField.ValueSet.DefineValue child = dict[data.SaleType] as UFIDA.U9.Base.FlexField.ValueSet.DefineValue ;
				if (child == null)
				{
					if (data.SaleType.ID>0)
					{
						if (data.SaleType.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.Base.FlexField.ValueSet.DefineValue)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.SaleType.ID,data.SaleType.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.Base.FlexField.ValueSet.DefineValue)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.SaleType.SysEntityType,null,data.SaleType.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.Base.FlexField.ValueSet.DefineValue)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.SaleType.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.SaleType, dict);
				}
				this.SaleType = child ;
			}
			else
				this.SaleType = null ;
			}

			this.DocState = UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState.GetFromValue(data.DocState);

			{
			if (data.Org!=null)
			{
				UFIDA.U9.Base.Organization.Organization child = dict[data.Org] as UFIDA.U9.Base.Organization.Organization ;
				if (child == null)
				{
					if (data.Org.ID>0)
					{
						if (data.Org.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.Base.Organization.Organization)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.Org.ID,data.Org.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.Base.Organization.Organization)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Org.SysEntityType,null,data.Org.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.Base.Organization.Organization)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Org.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.Org, dict);
				}
				this.Org = child ;
			}
			else
				this.Org = null ;
			}

			{
			if (data.WH!=null)
			{
				UFIDA.U9.CBO.SCM.Warehouse.Warehouse child = dict[data.WH] as UFIDA.U9.CBO.SCM.Warehouse.Warehouse ;
				if (child == null)
				{
					if (data.WH.ID>0)
					{
						if (data.WH.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.WH.ID,data.WH.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.WH.SysEntityType,null,data.WH.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.WH.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.WH, dict);
				}
				this.WH = child ;
			}
			else
				this.WH = null ;
			}

			this.Memo = data.Memo;

			{
			if (data.Dept!=null)
			{
				UFIDA.U9.CBO.HR.Department.Department child = dict[data.Dept] as UFIDA.U9.CBO.HR.Department.Department ;
				if (child == null)
				{
					if (data.Dept.ID>0)
					{
						if (data.Dept.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.HR.Department.Department)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.Dept.ID,data.Dept.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.HR.Department.Department)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Dept.SysEntityType,null,data.Dept.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.HR.Department.Department)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Dept.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.Dept, dict);
				}
				this.Dept = child ;
			}
			else
				this.Dept = null ;
			}

			this.CreditNoCheck = data.CreditNoCheck;

			this.MDDocNo = data.MDDocNo;

			this.GSCheck = data.GSCheck;

			this.KHCheck = data.KHCheck;

			this.MDMemo = data.MDMemo;

	
			if (data.Lines != null)
			{	
				List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO> listLines = new List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO>();
				foreach(UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTOData obj in data.Lines ){

					UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO child = dict[obj] as UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO;
					if (child == null)
					{
						child = new UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO();
						child.FromEntityData(obj,dict);
					}
					//值对象应该是依赖主创建的.但此处可能不是.
					listLines.Add(child);
				
				}
				this.Lines = listLines;
			}

		}

		/// <summary>
		/// Create EntityData From Entity
		/// </summary>
		public FastShipDTOData ToEntityData()
		{
			return ToEntityData(null,new Hashtable());
		}
		/// <summary>
		/// Create EntityData From Entity - used by ubf 
		/// </summary>
		public FastShipDTOData ToEntityData(FastShipDTOData data, IDictionary dict){
			if (data == null)
				data = new FastShipDTOData();
			if (dict == null ) 
				dict = new Hashtable() ;
			else
            {
                if (dict.Contains(this))
                {
                    data = (FastShipDTOData)dict[this];
                    return data;
                }
            }
			dict[this] = data;
		
			if (this.DocType!=null)
			{
				data.DocType=this.DocType.ToEntityData(null,dict);
			}

			data.DocNo = this.DocNo;

			if (this.Customer!=null)
			{
				data.Customer=this.Customer.ToEntityData(null,dict);
			}

			data.DocDate = this.DocDate;

			if (this.SaleWH!=null)
			{
				data.SaleWH=this.SaleWH.ToEntityData(null,dict);
			}

			data.IsZY = this.IsZY;

			if (this.ZYCustomer!=null)
			{
				data.ZYCustomer=this.ZYCustomer.ToEntityData(null,dict);
			}

			if (this.SaleType!=null)
			{
				data.SaleType=this.SaleType.ToEntityData(null,dict);
			}

			if (this.DocState!=null)
			{
				data.DocState = this.DocState.Value;
			}

			if (this.Org!=null)
			{
				data.Org=this.Org.ToEntityData(null,dict);
			}

			if (this.WH!=null)
			{
				data.WH=this.WH.ToEntityData(null,dict);
			}

			data.Memo = this.Memo;

			if (this.Dept!=null)
			{
				data.Dept=this.Dept.ToEntityData(null,dict);
			}

			data.CreditNoCheck = this.CreditNoCheck;

			data.MDDocNo = this.MDDocNo;

			data.GSCheck = this.GSCheck;

			data.KHCheck = this.KHCheck;

			data.MDMemo = this.MDMemo;

	
			if (this.Lines != null)
			{	
				List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTOData> listLines = new List<UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTOData>();
				foreach(UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTO obj in this.Lines ){
					if (obj==null) continue ;

					UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTOData old = dict[obj] as UFIDA.U9.Cust.SH.SHFastShipSV.FastShipLineDTOData;
					listLines.Add((old != null) ? old : obj.ToEntityData(null,dict));
				
				}
				data.Lines = listLines;
			}

			return data ;
		}

		#endregion	
	}	
	
}